<? 
	if (isset($_REQUEST["Acceptar"])){
	include("./connection");
	$connection=mysql_connect($server, $user, $passwd);
	$db= mysql_select_db($name_db, $connection);
	$sql="INSERT INTO login (email,nom,cnom1,cnom2,id_tipus) VALUES (".$_REQUEST["email"].", ".$_REQUEST["nom"].", ".$_REQUEST["cnom1"].",".$_REQUEST["cnom2]".", 2)";
	rs=mysql_query($sql, $connection);
	header("Location: ./index.php");
	} 

?>
<html>
<head>
	<title>Registre d'usuaris</title>
</head>
<body>
	<form accept="registre.php" method="POST">
		email: <input type="text" name="email">
		Nom: <input type="text" name="nom">
		Primer cognom: <input type="text" name="cnom1">
		Segon cognom: <input type="text" name="cnom2">
		<input type="submit" name="Aceptar" value="Aceptar">
	</form>
	
</body>
</html>